package cn.itcast.order.service;

import cn.itcast.order.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * feign调远程接口，与http类似
 * 直接写接口名即可
 * */
@FeignClient("userservice") //其中参数填写的是微服务名userservice
public interface UserClient {
    @GetMapping("/user/{id}") //其中参数填写的是请求路径
    User findById(@PathVariable("id") Long id);
}
